home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / OPTIMIZE / ALGORITH.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-16  |  4.2 KB  |  133 lines

  1. VERSION 5.00
  2. Begin VB.Form Algorithms 
  3.    Appearance      =   0  'Flat
  4.    AutoRedraw      =   -1  'True
  5.    BackColor       =   &H00FFFFFF&
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Algorithms"
  8.    ClientHeight    =   3810
  9.    ClientLeft      =   2265
  10.    ClientTop       =   1875
  11.    ClientWidth     =   6060
  12.    BeginProperty Font 
  13.       Name            =   "MS Sans Serif"
  14.       Size            =   8.25
  15.       Charset         =   0
  16.       Weight          =   700
  17.       Underline       =   0   'False
  18.       Italic          =   0   'False
  19.       Strikethrough   =   0   'False
  20.    EndProperty
  21.    ForeColor       =   &H80000008&
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    PaletteMode     =   1  'UseZOrder
  26.    ScaleHeight     =   3810
  27.    ScaleWidth      =   6060
  28.    ShowInTaskbar   =   0   'False
  29.    Tag             =   "Display"
  30.    WhatsThisHelp   =   -1  'True
  31.    Begin VB.Frame Frame1 
  32.       Caption         =   "Redraw Speed"
  33.       Height          =   1575
  34.       Left            =   195
  35.       TabIndex        =   0
  36.       Top             =   120
  37.       Width           =   5655
  38.       Begin VB.CheckBox Check1 
  39.          Caption         =   "AutoRedraw"
  40.          Height          =   255
  41.          Left            =   240
  42.          TabIndex        =   6
  43.          Top             =   1200
  44.          Value           =   1  'Checked
  45.          Width           =   2175
  46.       End
  47.       Begin VB.OptionButton optLineStyle 
  48.          Caption         =   "Lines using Vars"
  49.          Height          =   375
  50.          Index           =   1
  51.          Left            =   240
  52.          TabIndex        =   2
  53.          Top             =   720
  54.          Width           =   2895
  55.       End
  56.       Begin VB.OptionButton optLineStyle 
  57.          Caption         =   "Lines using Properties"
  58.          Height          =   255
  59.          Index           =   0
  60.          Left            =   240
  61.          TabIndex        =   1
  62.          Top             =   360
  63.          Width           =   2775
  64.       End
  65.       Begin VB.Label Label1 
  66.          Appearance      =   0  'Flat
  67.          BackColor       =   &H80000005&
  68.          Caption         =   "Label1"
  69.          ForeColor       =   &H80000008&
  70.          Height          =   255
  71.          Left            =   240
  72.          TabIndex        =   5
  73.          Top             =   1200
  74.          Width           =   1455
  75.       End
  76.       Begin VB.Label lblAlgorithm 
  77.          Caption         =   "00.00 secs."
  78.          Height          =   255
  79.          Index           =   1
  80.          Left            =   4080
  81.          TabIndex        =   4
  82.          Top             =   840
  83.          Width           =   1335
  84.       End
  85.       Begin VB.Label lblAlgorithm 
  86.          AutoSize        =   -1  'True
  87.          Caption         =   "00.00 secs."
  88.          Height          =   375
  89.          Index           =   0
  90.          Left            =   4080
  91.          TabIndex        =   3
  92.          Top             =   360
  93.          Width           =   1215
  94.          WordWrap        =   -1  'True
  95.       End
  96.    End
  97. Attribute VB_Name = "Algorithms"
  98. Attribute VB_GlobalNameSpace = False
  99. Attribute VB_Creatable = False
  100. Attribute VB_TemplateDerived = False
  101. Attribute VB_PredeclaredId = True
  102. Attribute VB_Exposed = False
  103. Private Sub Check1_Click()
  104.     ' Toggle AutoRedraw property.
  105.     Cls
  106.     Me.AutoRedraw = Not Me.AutoRedraw
  107. End Sub
  108. Private Sub Form_Load()
  109.   PosForm Me
  110.   Label1 = "AutoRedraw = " & Me.AutoRedraw
  111. End Sub
  112. Private Sub optLineStyle_Click(Index As Integer)
  113.     Cls
  114.     If optLineStyle(0) Then
  115.         start = Timer
  116.         For y = 1 To Me.ScaleHeight Step 5
  117.             Line (0, (Me.ScaleHeight - y))-(Me.ScaleWidth, (Me.ScaleHeight - y))
  118.         Next y
  119.         Finish = Timer
  120.         lblAlgorithm(0) = Format$(Finish - start, "##.##") & " secs."
  121.     Else
  122.         frmWidth = Me.ScaleWidth
  123.         frmHeight = Me.ScaleHeight
  124.         start = Timer
  125.         For y = 1 To frmHeight Step 5
  126.             x = frmHeight - y
  127.             Line (0, x)-(frmWidth, x)
  128.         Next y
  129.         Finish = Timer
  130.         lblAlgorithm(1) = Format$(Finish - start, "##.##") & " secs."
  131.     End If
  132. End Sub
  133.